<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理员列表-添加管理员</title>
<link href="__PUBLIC__/admin/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="__PUBLIC__/admin/js/jquery.js"></script>

<link href="__PUBLIC__/admin/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/select-ui.min.js"></script>

<link href="__PUBLIC__/validform/Validform.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/validform/Validform_v5.3.2.js"></script>
<script type="text/javascript" src="__PUBLIC__/validform/Validform_Datatype.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
    $("#role").uedSelect({
		width : 345			  
	});
});

function showschool(v){
	if(v==3){ //代理组显示学校选择
		$("#school_info").show();
	}else{
		$("#school_info").hide();
	}
}
</script>
<style>
#schoolinfo {margin-left: 86px;}
#schoolinfo label{width: 30%;}
</style>
</head>

<body>

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="{:U('index/welcome')}">首页</a></li>
			<li><a href="{:U('admin/index')}">管理员列表</a></li>
			<li><a href="#">添加管理员</a></li>
		</ul>
    </div>
    
    <div class="formbody">
    
		<div class="formtitle"><span>添加管理员</span></div>

		<form name="myform" id="myform" action="{:U('admin/addadmin')}" method="post">
			<ul class="forminfo">
				<li><label>用户名</label><input name="info[username]" id="username" type="text" class="dfinput" ajaxurl="{:U('admin/existadmin')}" datatype="*5-15" errormsg="用户名范围在5~15位之间！" maxlength="20" /><i class="Validform_checktip"></i></li>
				<li><label>手机号码</label><input name="info[phone]" id="phone" type="text" class="dfinput" datatype="phone" errormsg="手机号码不能为空！" maxlength="20" /><i class="Validform_checktip"></i></li>
				<li><label>真实名称</label><input name="info[realname]" id="realname" type="text" class="dfinput" datatype="*" errormsg="真实名称不能为空！" maxlength="10" /><i class="Validform_checktip"></i></li>
				<li><label>密码</label><input name="info[password]" id="password" type="password" class="dfinput" datatype="*5-15" nullmsg="请输入原密码！" errormsg="密码范围在5~15位之间！" maxlength="20" /><i class="Validform_checktip"></i></li>
				<li><label>确认密码</label><input name="password2" id="password2" type="password" class="dfinput" datatype="*" recheck="info[password]" nullmsg="请再输入一次密码！" errormsg="您两次输入的密码不一致！" maxlength="20" /><i class="Validform_checktip"></i></li>
				<li><label>角色</label>
					<div class="vocation">
						<select id="role" name="info[role]" datatype="*" errormsg="角色不能为空！" onchange="showschool(this.value);">
							<option value="">选择角色</option>
							<volist name="groupinfo" id="data">
							<option value="{$data.group_id}">{$data.group_name}</option>
							</volist>
						</select>
					</div>
					<i class="Validform_checktip"></i>
				</li>

				<li><label>&nbsp;</label><input name="loginbtn" type="submit" class="btn" value="确认保存"/></li>
			</ul>
		</form>
    
    </div>

	<script>
	$(function(){
		$("#myform").Validform({
			//tiptype:2
			tiptype:function(msg,o,cssctl){
				var objtip=o.obj.siblings(".Validform_checktip");
				cssctl(objtip,o.type);
				objtip.text(msg);
			}
		});
	}); 
	</script>
</body>

</html>
